package com.woniuxy.controller;

import com.woniuxy.entity.dto.OrderParamDTO;
import com.woniuxy.service.OrderService;
import com.woniuxy.util.ResponseData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.ParseException;

/**
 * @author dingpf
 * @version 1.0
 * @description
 * @create 2025/4/25 17:14
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/addOrder")
    public ResponseData addOrder(@RequestBody OrderParamDTO orderParamDTO) {
        try {
            return orderService.addOrder(orderParamDTO);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException();
        }
    }
}
